import { getCharge ,getWinterCamp} from 'api/wxpay'
const wxpay = {
  state: {

  },
  getters: {

  },
  actions: {
    GetPayCharge: function({ commit }, option) {
      return new Promise((resolve, reject) => {
        getCharge(option).then(response => {
          let charge = response.data;
          charge.package = charge.payPackage;
          delete charge.payPackage;
          resolve(charge);
        }).catch(error => {
          reject(error)
        })
      })
    },
    GetWinterCampChange: function({ commit }, option) {
      return new Promise((resolve, reject) => {
        getWinterCamp(option).then(response => {
          let charge = response.data;
          charge.package = charge.payPackage;
          delete charge.payPackage;
          resolve(charge);
        }).catch(error => {
          reject(error)
        })
      })
    },
  },
  mutations: {

  }
}
export default wxpay
